package cn.com.yusys.yusp.admin.web.rest;

import cn.com.yusys.yusp.admin.service.CustomerViewInfoService;
import cn.com.yusys.yusp.commons.mapper.QueryModel;
import cn.com.yusys.yusp.commons.web.rest.dto.ResultDto;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
import java.util.List;
import java.util.Map;

/**
 * @author zhoukanghui
 * @version 1.0
 * @date 2021/7/14 16:38
 * 客户视图展示相关信息
 */
@RestController
@RequestMapping("/api/custviewInfo")
public class CustomerViewInfoResource {

    @Resource
    private CustomerViewInfoService customerViewInfoService;

    /**
     * 客户基本信息查询
     * @param queryModel
     * @return
     */
    @GetMapping("/getCustomerInformation")
    public ResultDto<List<Map<String, Object>>> getCustomerInformation(QueryModel queryModel){
        List<Map<String, Object>> baseInfo = customerViewInfoService.getCustInfomation(queryModel);
        return new ResultDto<>(baseInfo);
    }

    /**
     * 客户时间轴
     * @param queryModel
     * @return
     */
    @GetMapping("/getTimeAxs")
    public ResultDto<List<Map<String, Object>>> getCustVisitedRecords(QueryModel queryModel){
        List<Map<String, Object>> visitInfo = customerViewInfoService.getTimeAxsInfomation(queryModel);
        return new ResultDto<>(visitInfo);
    }

    /**
     * 客户资产时点余额
     * @param queryModel
     * @return
     */
    @GetMapping("/getAssetTime")
    public ResultDto<List<Map<String, Object>>> getCustAssetTime(QueryModel queryModel){
        List<Map<String, Object>> assetInfo = customerViewInfoService.getCustAssetTime(queryModel);
        return new ResultDto<>(assetInfo);
    }

    /**
     * 客户负债时点余额
     * @param queryModel
     * @return
     */
    @GetMapping("/getliabilityInfo")
    public ResultDto<List<Map<String, Object>>> getliabilityInfo(QueryModel queryModel){
        List<Map<String, Object>> libInfo = customerViewInfoService.getliabilityInfo(queryModel);
        return new ResultDto<>(libInfo);
    }

    /**
     * 客户半年资产波动图展示
     * @param queryModel
     * @return
     */
    @GetMapping("/getAssertsChangeMonthTrend")
    public ResultDto<List<Map<String, Object>>> getAssertsChangeMonthTrend(QueryModel queryModel){
        List<Map<String, Object>> changeInfo = customerViewInfoService.getAssertsChangeMonthTrend(queryModel);
        return new ResultDto<>(changeInfo);
    }

    /**
     * 客户存款明细
     * @param queryModel
     * @return
     */
    @GetMapping("/getCustDepInfo")
    public ResultDto<List<Map<String, Object>>> getCustDepInfo(QueryModel queryModel){
        List<Map<String, Object>> depInfo = customerViewInfoService.getCustDepInfo(queryModel);
        return new ResultDto<>(depInfo);
    }

    /**
     * 客户贷款明细
     * @param queryModel
     * @return
     */
    @GetMapping("/getCustLoanInfo")
    public ResultDto<List<Map<String, Object>>> getCustLoanInfo(QueryModel queryModel){
        List<Map<String, Object>> loanInfo = customerViewInfoService.getCustLoanInfo(queryModel);
        return new ResultDto<>(loanInfo);
    }

    /**
     * 客户理财明细
     * @param queryModel
     * @return
     */
    @GetMapping("/getCustFincInfo")
    public ResultDto<List<Map<String, Object>>> getCustFincInfo(QueryModel queryModel){
        List<Map<String, Object>> fincInfo = customerViewInfoService.getCustFincInfo(queryModel);
        return new ResultDto<>(fincInfo);
    }

    /**
     * 客户基金明细
     * @param queryModel
     * @return
     */
    @GetMapping("/getCustFundInfo")
    public ResultDto<List<Map<String, Object>>> getCustFundInfo(QueryModel queryModel){
        List<Map<String, Object>> fundInfo = customerViewInfoService.getCustFundInfo(queryModel);
        return new ResultDto<>(fundInfo);
    }

    /**
     * 客户保险明细
     * @param queryModel
     * @return
     */
    @GetMapping("/getCustBxInfo")
    public ResultDto<List<Map<String, Object>>> getCustBxInfo(QueryModel queryModel){
        List<Map<String, Object>> bxInfo = customerViewInfoService.getCustBxInfo(queryModel);
        return new ResultDto<>(bxInfo);
    }

    /**
     * 客户信托明细
     * @param queryModel
     * @return
     */
    @GetMapping("/getCustXtInfo")
    public ResultDto<List<Map<String, Object>>> getCustXtInfo(QueryModel queryModel){
        List<Map<String, Object>> xtInfo = customerViewInfoService.getCustXtInfo(queryModel);
        return new ResultDto<>(xtInfo);
    }

    /**
     * 客户持有产品标签信息
     * @param queryModel
     * @return
     */
    @GetMapping("/getCustTags")
    public ResultDto<List<Map<String, Object>>> getCustTags(QueryModel queryModel){
        List<Map<String, Object>> tagInfo = customerViewInfoService.getCustAllTags(queryModel);
        return new ResultDto<>(tagInfo);
    }

    /**
     * 关联关系-家庭关系
     * @param queryModel
     * @return
     */
    @GetMapping("/getFmyRel")
    public ResultDto<List<Map<String, Object>>> getFmyRel(QueryModel queryModel){
        List<Map<String, Object>> fmyInfo = customerViewInfoService.getFmyRel(queryModel);
        return new ResultDto<>(fmyInfo);
    }

    /**
     * 关联关系-资金流向
     * @param queryModel
     * @return
     */
    @GetMapping("/getFndFlow")
    public ResultDto<List<Map<String, Object>>> getFndFlow(QueryModel queryModel){
        List<Map<String, Object>> fndFlowInfo = customerViewInfoService.getFndFlow(queryModel);
        return new ResultDto<>(fndFlowInfo);
    }

    /**
     * 关联关系-担保关系
     * @param queryModel
     * @return
     */
    @GetMapping("/getGurtRel")
    public ResultDto<List<Map<String, Object>>> getGurtRel(QueryModel queryModel){
        List<Map<String, Object>> gurtInfo = customerViewInfoService.getGurtRel(queryModel);
        return new ResultDto<>(gurtInfo);
    }

    /**
     * 关联关系-对外投资
     * @param queryModel
     * @return
     */
    @GetMapping("/getExtIvs")
    public ResultDto<List<Map<String, Object>>> getExtIvs(QueryModel queryModel){
        List<Map<String, Object>> ivsInfo = customerViewInfoService.getExtIvs(queryModel);
        return new ResultDto<>(ivsInfo);
    }

    /**
     * 客户网格归属历史信息查询
     * @param queryModel
     * @return
     */
    @GetMapping("/getCustGridBelongHis")
    public ResultDto<List<Map<String, Object>>> getCustGridBelongHis(QueryModel queryModel){
        List<Map<String, Object>> belongInfo = customerViewInfoService.getCustBelongHis(queryModel);
        return new ResultDto<>(belongInfo);
    }
}
